package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the customer database table.
 * 
 */
@Entity
@Table(name="customer")
@NamedQuery(name="Customer.findAll", query="SELECT c FROM Customer c")
public class Customer implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String cid;

	private String ccity;

	@Temporal(TemporalType.DATE)
	private Date cdate;

	private String cemail;

	private String clife;

	private String cname;

	private String cnote;

	private String cprovinces;

	private String ctel;

	//bi-directional many-to-one association to Actionhistory
	@OneToMany(mappedBy="customerBean")
	private List<Actionhistory> actionhistories;

	//bi-directional many-to-one association to Commissiontask
	@OneToMany(mappedBy="customerBean")
	private List<Commissiontask> commissiontasks;

	//bi-directional many-to-one association to Contact
	@OneToMany(mappedBy="customer")
	private List<Contact> contacts;

	//bi-directional many-to-one association to Kind
	@ManyToOne
	@JoinColumn(name="ctype")
	private Kind kind;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="cbelong")
	private Staff staff;

	//bi-directional many-to-one association to Delivery
	@OneToMany(mappedBy="customer")
	private List<Delivery> deliveries;

	//bi-directional many-to-one association to Detailedrequirement
	@OneToMany(mappedBy="customerBean")
	private List<Detailedrequirement> detailedrequirements;

	//bi-directional many-to-one association to Move
	@OneToMany(mappedBy="customer")
	private List<Move> moves;

	//bi-directional many-to-one association to Order
	@OneToMany(mappedBy="customer")
	private List<Order> orders;

	//bi-directional many-to-one association to Payment
	@OneToMany(mappedBy="customer")
	private List<Payment> payments;

	//bi-directional many-to-one association to Plannedreturn
	@OneToMany(mappedBy="customer")
	private List<Plannedreturn> plannedreturns;

	//bi-directional many-to-one association to Quotationrecord
	@OneToMany(mappedBy="customerBean")
	private List<Quotationrecord> quotationrecords;

	//bi-directional many-to-one association to Returned
	@OneToMany(mappedBy="customer")
	private List<Returned> returneds;

	//bi-directional many-to-one association to Returnmoney
	@OneToMany(mappedBy="customer")
	private List<Returnmoney> returnmoneys;

	//bi-directional many-to-one association to Salesopportunity
	@OneToMany(mappedBy="customerBean")
	private List<Salesopportunity> salesopportunities;

	//bi-directional many-to-one association to Send
	@OneToMany(mappedBy="customer")
	private List<Send> sends;

	//bi-directional many-to-one association to Task
	@OneToMany(mappedBy="customer")
	private List<Task> tasks;

	//bi-directional many-to-one association to Tousuc
	@OneToMany(mappedBy="customer")
	private List<Tousuc> tousucs;

	//bi-directional many-to-one association to Weixiuonac
	@OneToMany(mappedBy="customer")
	private List<Weixiuonac> weixiuonacs;

	public Customer() {
	}

	public String getCid() {
		return this.cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getCcity() {
		return this.ccity;
	}

	public void setCcity(String ccity) {
		this.ccity = ccity;
	}

	public Date getCdate() {
		return this.cdate;
	}

	public void setCdate(Date cdate) {
		this.cdate = cdate;
	}

	public String getCemail() {
		return this.cemail;
	}

	public void setCemail(String cemail) {
		this.cemail = cemail;
	}

	public String getClife() {
		return this.clife;
	}

	public void setClife(String clife) {
		this.clife = clife;
	}

	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public String getCnote() {
		return this.cnote;
	}

	public void setCnote(String cnote) {
		this.cnote = cnote;
	}

	public String getCprovinces() {
		return this.cprovinces;
	}

	public void setCprovinces(String cprovinces) {
		this.cprovinces = cprovinces;
	}

	public String getCtel() {
		return this.ctel;
	}

	public void setCtel(String ctel) {
		this.ctel = ctel;
	}

	public List<Actionhistory> getActionhistories() {
		return this.actionhistories;
	}

	public void setActionhistories(List<Actionhistory> actionhistories) {
		this.actionhistories = actionhistories;
	}

	public Actionhistory addActionhistory(Actionhistory actionhistory) {
		getActionhistories().add(actionhistory);
		actionhistory.setCustomerBean(this);

		return actionhistory;
	}

	public Actionhistory removeActionhistory(Actionhistory actionhistory) {
		getActionhistories().remove(actionhistory);
		actionhistory.setCustomerBean(null);

		return actionhistory;
	}

	public List<Commissiontask> getCommissiontasks() {
		return this.commissiontasks;
	}

	public void setCommissiontasks(List<Commissiontask> commissiontasks) {
		this.commissiontasks = commissiontasks;
	}

	public Commissiontask addCommissiontask(Commissiontask commissiontask) {
		getCommissiontasks().add(commissiontask);
		commissiontask.setCustomerBean(this);

		return commissiontask;
	}

	public Commissiontask removeCommissiontask(Commissiontask commissiontask) {
		getCommissiontasks().remove(commissiontask);
		commissiontask.setCustomerBean(null);

		return commissiontask;
	}

	public List<Contact> getContacts() {
		return this.contacts;
	}

	public void setContacts(List<Contact> contacts) {
		this.contacts = contacts;
	}

	public Contact addContact(Contact contact) {
		getContacts().add(contact);
		contact.setCustomer(this);

		return contact;
	}

	public Contact removeContact(Contact contact) {
		getContacts().remove(contact);
		contact.setCustomer(null);

		return contact;
	}

	public Kind getKind() {
		return this.kind;
	}

	public void setKind(Kind kind) {
		this.kind = kind;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<Delivery> getDeliveries() {
		return this.deliveries;
	}

	public void setDeliveries(List<Delivery> deliveries) {
		this.deliveries = deliveries;
	}

	public Delivery addDelivery(Delivery delivery) {
		getDeliveries().add(delivery);
		delivery.setCustomer(this);

		return delivery;
	}

	public Delivery removeDelivery(Delivery delivery) {
		getDeliveries().remove(delivery);
		delivery.setCustomer(null);

		return delivery;
	}

	public List<Detailedrequirement> getDetailedrequirements() {
		return this.detailedrequirements;
	}

	public void setDetailedrequirements(List<Detailedrequirement> detailedrequirements) {
		this.detailedrequirements = detailedrequirements;
	}

	public Detailedrequirement addDetailedrequirement(Detailedrequirement detailedrequirement) {
		getDetailedrequirements().add(detailedrequirement);
		detailedrequirement.setCustomerBean(this);

		return detailedrequirement;
	}

	public Detailedrequirement removeDetailedrequirement(Detailedrequirement detailedrequirement) {
		getDetailedrequirements().remove(detailedrequirement);
		detailedrequirement.setCustomerBean(null);

		return detailedrequirement;
	}

	public List<Move> getMoves() {
		return this.moves;
	}

	public void setMoves(List<Move> moves) {
		this.moves = moves;
	}

	public Move addMove(Move move) {
		getMoves().add(move);
		move.setCustomer(this);

		return move;
	}

	public Move removeMove(Move move) {
		getMoves().remove(move);
		move.setCustomer(null);

		return move;
	}

	public List<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public Order addOrder(Order order) {
		getOrders().add(order);
		order.setCustomer(this);

		return order;
	}

	public Order removeOrder(Order order) {
		getOrders().remove(order);
		order.setCustomer(null);

		return order;
	}

	public List<Payment> getPayments() {
		return this.payments;
	}

	public void setPayments(List<Payment> payments) {
		this.payments = payments;
	}

	public Payment addPayment(Payment payment) {
		getPayments().add(payment);
		payment.setCustomer(this);

		return payment;
	}

	public Payment removePayment(Payment payment) {
		getPayments().remove(payment);
		payment.setCustomer(null);

		return payment;
	}

	public List<Plannedreturn> getPlannedreturns() {
		return this.plannedreturns;
	}

	public void setPlannedreturns(List<Plannedreturn> plannedreturns) {
		this.plannedreturns = plannedreturns;
	}

	public Plannedreturn addPlannedreturn(Plannedreturn plannedreturn) {
		getPlannedreturns().add(plannedreturn);
		plannedreturn.setCustomer(this);

		return plannedreturn;
	}

	public Plannedreturn removePlannedreturn(Plannedreturn plannedreturn) {
		getPlannedreturns().remove(plannedreturn);
		plannedreturn.setCustomer(null);

		return plannedreturn;
	}

	public List<Quotationrecord> getQuotationrecords() {
		return this.quotationrecords;
	}

	public void setQuotationrecords(List<Quotationrecord> quotationrecords) {
		this.quotationrecords = quotationrecords;
	}

	public Quotationrecord addQuotationrecord(Quotationrecord quotationrecord) {
		getQuotationrecords().add(quotationrecord);
		quotationrecord.setCustomerBean(this);

		return quotationrecord;
	}

	public Quotationrecord removeQuotationrecord(Quotationrecord quotationrecord) {
		getQuotationrecords().remove(quotationrecord);
		quotationrecord.setCustomerBean(null);

		return quotationrecord;
	}

	public List<Returned> getReturneds() {
		return this.returneds;
	}

	public void setReturneds(List<Returned> returneds) {
		this.returneds = returneds;
	}

	public Returned addReturned(Returned returned) {
		getReturneds().add(returned);
		returned.setCustomer(this);

		return returned;
	}

	public Returned removeReturned(Returned returned) {
		getReturneds().remove(returned);
		returned.setCustomer(null);

		return returned;
	}

	public List<Returnmoney> getReturnmoneys() {
		return this.returnmoneys;
	}

	public void setReturnmoneys(List<Returnmoney> returnmoneys) {
		this.returnmoneys = returnmoneys;
	}

	public Returnmoney addReturnmoney(Returnmoney returnmoney) {
		getReturnmoneys().add(returnmoney);
		returnmoney.setCustomer(this);

		return returnmoney;
	}

	public Returnmoney removeReturnmoney(Returnmoney returnmoney) {
		getReturnmoneys().remove(returnmoney);
		returnmoney.setCustomer(null);

		return returnmoney;
	}

	public List<Salesopportunity> getSalesopportunities() {
		return this.salesopportunities;
	}

	public void setSalesopportunities(List<Salesopportunity> salesopportunities) {
		this.salesopportunities = salesopportunities;
	}

	public Salesopportunity addSalesopportunity(Salesopportunity salesopportunity) {
		getSalesopportunities().add(salesopportunity);
		salesopportunity.setCustomerBean(this);

		return salesopportunity;
	}

	public Salesopportunity removeSalesopportunity(Salesopportunity salesopportunity) {
		getSalesopportunities().remove(salesopportunity);
		salesopportunity.setCustomerBean(null);

		return salesopportunity;
	}

	public List<Send> getSends() {
		return this.sends;
	}

	public void setSends(List<Send> sends) {
		this.sends = sends;
	}

	public Send addSend(Send send) {
		getSends().add(send);
		send.setCustomer(this);

		return send;
	}

	public Send removeSend(Send send) {
		getSends().remove(send);
		send.setCustomer(null);

		return send;
	}

	public List<Task> getTasks() {
		return this.tasks;
	}

	public void setTasks(List<Task> tasks) {
		this.tasks = tasks;
	}

	public Task addTask(Task task) {
		getTasks().add(task);
		task.setCustomer(this);

		return task;
	}

	public Task removeTask(Task task) {
		getTasks().remove(task);
		task.setCustomer(null);

		return task;
	}

	public List<Tousuc> getTousucs() {
		return this.tousucs;
	}

	public void setTousucs(List<Tousuc> tousucs) {
		this.tousucs = tousucs;
	}

	public Tousuc addTousuc(Tousuc tousuc) {
		getTousucs().add(tousuc);
		tousuc.setCustomer(this);

		return tousuc;
	}

	public Tousuc removeTousuc(Tousuc tousuc) {
		getTousucs().remove(tousuc);
		tousuc.setCustomer(null);

		return tousuc;
	}

	public List<Weixiuonac> getWeixiuonacs() {
		return this.weixiuonacs;
	}

	public void setWeixiuonacs(List<Weixiuonac> weixiuonacs) {
		this.weixiuonacs = weixiuonacs;
	}

	public Weixiuonac addWeixiuonac(Weixiuonac weixiuonac) {
		getWeixiuonacs().add(weixiuonac);
		weixiuonac.setCustomer(this);

		return weixiuonac;
	}

	public Weixiuonac removeWeixiuonac(Weixiuonac weixiuonac) {
		getWeixiuonacs().remove(weixiuonac);
		weixiuonac.setCustomer(null);

		return weixiuonac;
	}

}